<!--
 * @Author: 贾博林 11457230+jabolin@user.noreply.gitee.com
 * @Date: 2022-10-21 21:43:07
 * @LastEditors: 贾博林 11457230+jabolin@user.noreply.gitee.com
 * @LastEditTime: 2022-10-25 11:15:54
 * @FilePath: \v-shop\code\src\views\rights.vue
 * @Description: rights页面
-->
<template>
  <div>
    <!-- 面包屑 -->
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表</el-breadcrumb-item>
    </el-breadcrumb>

    <!-- 卡片 -->
    <el-card>
      <!-- 表格 -->
      <el-table :data="rights" border style="width: 100%">
        <el-table-column fixed type="index" label="#">
        </el-table-column>
        <el-table-column prop="authName" label="权限名称">
        </el-table-column>
        <el-table-column prop="path" label="路径">
        </el-table-column>
        <el-table-column prop="level" label="权限等级">
          <!-- 插槽标签 -->
          <template slot-scope="scope">
            <el-tag v-if='scope.row.level == 0'>一级</el-tag>
            <el-tag v-if='scope.row.level == 1' type="success">二级</el-tag>
            <el-tag v-if='scope.row.level == 2' type="info">三级</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { rights, } from '../http/rights/api'
export default {
  name: 'rights',
  data() {
    return {
      rights: []
    };
  },

  components: {},

  computed: {},

  // 钩子函数
  mounted() {
    this.getdata()
  },

  // 方法
  methods: {
    // 渲染
    getdata() {
      rights("/list").then(res => {
        console.log(res, "rights");
        this.rights = res.data.data
      })
    }
  },
  watch: {},
  mixins: []
}

</script>
<style  scoped>

</style>